package com.soft.javase.day11.recursion;

/**
 * @author yzg
 * @desc TODO
 * @date 2025/5/9
 */
public class MonkeyPeach {
    public static void main(String[] args) {
        System.out.println("第一天摘了 " + getPeachCount(1) + " 个桃子");
    }


    public static int getPeachCount(int day) {
        if (day == 10) {
            return 1;
        } else {
            // 前一天的桃子数 = (当天桃子数 + 1) * 2
            return (getPeachCount(day + 1) + 1) * 2;
        }
    }
}